]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Avoid using key.label for anything else than presentation
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 15 Feb 2018 12:23:54 +0000 (13:23 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 15 Feb 2018 18:36:41 +0000 (19:36 +0100)
Do the finicky checks to adjust key widths and whatnot based on other
values than the label. This makes the label exclusively used for
presentation (i.e. setting up a St.Label).

https://gitlab.gnome.org/GNOME/gnome-shell/issues/46

js/ui/keyboard.js

index 37e86fdb74db707a966ad40ef393c7af962f8764..a830fdd054569658e65f12161bf8fa7bceffb42c 100644 (file)
@@ -849,7 +849,8 @@ var Keyboard = new Lang.Class({
             }
 
             /* Fixup default keys based on the number of levels/keys */
-            if (key.label == '⇧' && numLevels == 3) {
+            if (switchToLevel == 1 && numLevels == 3) {
+                // Hide shift key if the keymap has no uppercase level
                 if (key.right) {
                     /* Only hide the key actor, so the container still takes space */
                     extraButton.keyButton.hide();
@@ -859,7 +860,7 @@ var Keyboard = new Lang.Class({
                 extraButton.setWidth(1.5);
             } else if (key.right && numKeys > 8) {
                 extraButton.setWidth(2);
-            } else if (key.label == '⏎' && numKeys > 9) {
+            } else if (keyval == Clutter.KEY_Return && numKeys > 9) {
                 extraButton.setWidth(1.5);
             }